<include file="Base/header" /> 	
<div class="page-container">
	<include file="Base/menu" /> 
	<div class="page-content">
		<div class="container-fluid">
			<div class="row-fluid">
					<div class="span12"> 
						<!-- BEGIN PAGE TITLE & BREADCRUMB-->
						<h3 class="page-title">
						</h3>
						<ul class="breadcrumb">
							<li>
								<i class="icon-home"></i>
								<a href="/index.php/Admin/">首页</a> 
								<i class="icon-angle-right"></i>
							</li>
							<li><a href="/index.php/Admin/Other">工具</a></li>
						</ul>
						<!-- END PAGE TITLE & BREADCRUMB-->
					</div>
			</div>
			<div class="row-fluid">
					<div class="span12">
						<!-- BEGIN EXAMPLE TABLE PORTLET-->
						<div class="portlet box blue">
							<div class="portlet-title">
								<div class="caption"><i class="icon-globe"></i>管理员列表</div>
								<div class="tools">
									<a href="javascript:;" class="collapse"></a>
									<a href="javascript:;" class="reload"></a>
									<a href="javascript:;" class="remove"></a>
								</div>
							</div>
							<div class="portlet-body">
                                <div class="clearfix">
                                    <div class="btn-group">
                                        <a href="__CONTROLLER__/cateAdd"><button id="sample_editable_1_new" class="btn green">
                                        新增&nbsp;&nbsp;<i class="icon-plus"></i>
                                        </button></a>
                                    </div>
                                </div>
                                <div id="sample_1_wrapper" class="dataTables_wrapper form-inline" role="grid">
                                <div class="row-fluid">
                                    <form method="get" action="__URL__/index" >
                                    <div class="span6">
                                        <div id="sample_1_length" class="dataTables_length">
                                                <select size="1" id="mySelect" name="page_size" aria-controls="sample_1" class="m-wrap small" onchange="submit(this.value)">
                                                    <option id="page10" value="10">10</option>
                                                    <option id="page20" value="20">20</option>
                                                    <option id="page50" value="50">50</option>
                                                    <option id="page100" value="100">100</option>
                                                </select> 条/每页</label>
                                            </div>
                                        </div>
                                    <div class="span6">
                                        <div class="dataTables_filter" id="sample_1_filter">
                                            <label>搜索: <input placeholder="输入要搜索的名称" name="user_name" type="text" aria-controls="sample_1" class="m-wrap medium"></label>
                                        </div>
                                    </div>
                                    </form>
                                </div>
<table class="table table-striped table-bordered table-hover dataTable" id="sample_1" aria-describedby="sample_1_info">
    <thead>
        <tr role="row">
            <th style="width: 24px;" class="sorting_disabled" role="columnheader"
            rowspan="1" colspan="1" aria-label="">
                <div class="checker">
                    <span>
                        <input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes">
                    </span>
                </div>
            </th>
            <th class="sorting" role="columnheader" tabindex="0" aria-controls="sample_1"
            rowspan="1" colspan="1" aria-label="" style="width: 50px;">
                ID
            </th>
            <th class="hidden-480 sorting_disabled" role="columnheader" rowspan="1"
            colspan="1" aria-label="Email" style="width: 50px;">
                分类名字
            </th>
            
            <th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample_1"
            rowspan="1" colspan="1" aria-label="" style="width: 40px;">
                添加时间
            </th>
            <th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample_1"
            rowspan="1" colspan="1" aria-label="" style="width: 40px;">
                说明
            </th>
            <th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample_1"
            rowspan="1" colspan="1" aria-label="" style="width: 40px;">
                分类
            </th>
            <th class="hidden-480 sorting_disabled" role="columnheader" rowspan="1"
            colspan="1" aria-label="Joined" style="width: 50px;">
                管理
             </th>

        </tr>
    </thead>
    <tbody role="alert" aria-live="polite" aria-relevant="all">
    <foreach name="data" item="vo"> 
     <tr class="gradeX odd">
            <td class=" sorting_1">
                <div class="checker">
                    <span>
                        <input type="checkbox" class="checkboxes" value="1">
                    </span>
                </div>
            </td>
            <td class="">{$vo.id}</td>
            <td class="hidden-480 ">{$vo.cate_name}</td>
            <td class="hidden-480 ">{$vo.add_time}</td>
            <td class="hidden-480 ">{$vo.explanation}</td>
            <td class="hidden-480 ">{$vo.status|getCateType}</td>
            <td class="center hidden-480 ">
                <a href="{:U('Admin/Device/cateUp',array('id'=>$vo['id']))}" style="cursor: pointer;">
                   编辑
                </a>
                <a id="del" onclick="del({$vo.id})" style="cursor: pointer;">
                   删除
                </a>
            </td>
        </tr>
    </foreach>
    </tbody>
</table>
<!-- 分页 -->
<div class="row-fluid">
    <div class="span6">
        <div class="dataTables_info" id="sample_1_info">
          共{$count}条数据记录。
        </div>
    </div>
    <div class="span6">
        <div class="dataTables_paginate paging_bootstrap pagination">
            {$page}
        </div>
    </div>
</div>								
								</div>
							</div>
						</div>
						<!-- END EXAMPLE TABLE PORTLET-->
					</div>
				</div>
		</div>
	</div>
</div>
<include file="Base/footer" /> 
<script src="__PUBLIC__/plugins/layer/layer.min.js"></script>
<script type="text/javascript">
function del(id){
        //询问框
    layer.confirm('是否确认删除此条记录', {
      btn: ['确认','取消'] //按钮
    }, function(){
        $.ajax({
            type:'POST',
            dataType: "json",
            url: "{:U('Admin/Device/cateDel')}",
            data: {"id":id},
            success:  function(result){
                if(result.status==1){
                    layer.alert(result.info,function(){self.location="__MODULE__/Device/cate";});
                }else if(result.status==0){
                    //失败
                    layer.alert(result.info);
                }
            }
        });
    }, function(index){
      layer.close(index);
    });
}
</script>
<script language="javascript" type="text/javascript">
    function submit(){
        $.ajax({
            type:"get",
            url:"index?page_size",
            async:false,
        })
    }
    element=document.getElementById('page'+{$Think.session.page_size});
    element.setAttribute("selected","selected");
</script>